home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
352_01
/
vecbase.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1991-04-22
|
620b
|
30 lines
/* VECBASE.CPP
* fill a Vector with uniform data values
* to use as a time base for graphing
* or for computing phase2time()
*/
#include <stdlib.h>
#include "wtwg.h"
#include "dblib.h"
#include "vector.h"
void Vector::base ( float start, float final )
{
float *vv =v; int vn =n;
float val;
float incr;
int i;
if ( vn == 0 ) werror ( 'V', "Vector::base() on zero length Vector");
incr = (final - start)/ vn;
for ( i=0, val=start; i< vn; ++i, val+=incr )
{
vv[i] = val;
}
return; /* Vector::base() */
}
//-------------------- end VECBASE.CPP ----------------------